﻿using System.Data.Objects;
using NOSDC.Pocos;

namespace NOSDC.Entities
{
    public sealed class NOSDCContext : ObjectContext
    {
        private ObjectSet<Article> _articles;
        private ObjectSet<EventAttendee> _attendees;
        private ObjectSet<FinalEventAttendee> _finalAttendees;
        private ObjectSet<Comment> _comments;
        private ObjectSet<Events> _events;
        private ObjectSet<Status> _status;
        private ObjectSet<UserDetail> _userDetails;
        private ObjectSet<Speaker> _speaker;
        private ObjectSet<Sponsor> _sponsor;
        private ObjectSet<Document> _documents;
        private ObjectSet<Polls> _polls;
        private ObjectSet<PollResults> _pollResults;
        private ObjectSet<Job> _jobs;
        private ObjectSet<PasswordRecovery> _passwordRecovery;

        public NOSDCContext() : base("name=NOSDCEntities", "NOSDCEntities")
        {
            ContextOptions.LazyLoadingEnabled = true;
        }

        #region Properties
        
        public ObjectSet<Article> Articles
        {
            get { return _articles ?? (_articles = CreateObjectSet<Article>()); }
        }

        public ObjectSet<Status> Status
        {
            get { return _status ?? (_status = CreateObjectSet<Status>()); }
        }

        public ObjectSet<Events> Events
        {
            get { return _events ?? (_events = CreateObjectSet<Events>()); }
        }

        public ObjectSet<EventAttendee> EventAttendees
        {
            get { return _attendees ?? (_attendees = CreateObjectSet<EventAttendee>()); }
        }

        public ObjectSet<UserDetail> UserDetails
        {
            get { return _userDetails ?? (_userDetails = CreateObjectSet<UserDetail>()); }
        }

        public ObjectSet<Comment> Comments
        {
            get { return _comments ?? (_comments = CreateObjectSet<Comment>()); }
        }

        public ObjectSet<Speaker> Speaker
        {
            get { return _speaker ?? (_speaker = CreateObjectSet<Speaker>()); }
        }

        public ObjectSet<Sponsor> Sponsor
        {
            get { return _sponsor ?? (_sponsor = CreateObjectSet<Sponsor>()); }
        }

        public ObjectSet<Document> Documents
        {
            get { return _documents ?? (_documents = CreateObjectSet<Document>()); }
        }

        public ObjectSet<Polls> Polls
        {
            get { return _polls ?? (_polls = CreateObjectSet<Polls>()); }
        }

        public ObjectSet<PollResults> PollResults
        {
            get { return _pollResults ?? (_pollResults = CreateObjectSet<PollResults>()); }
        }

        public ObjectSet<FinalEventAttendee> FinalEventAttendees
        {
            get { return _finalAttendees ?? (_finalAttendees = CreateObjectSet<FinalEventAttendee>()); }
        }

        public ObjectSet<Job> Jobs
        {
            get { return _jobs ?? (_jobs = CreateObjectSet<Job>()); }
        }

        public ObjectSet<PasswordRecovery> PasswordRecoveryRequest
        {
            get { return _passwordRecovery ?? (_passwordRecovery = CreateObjectSet<PasswordRecovery>()); }
        }

        #endregion
    }
}